package com.scsj.supermarket.view.activity.walletmodel;

import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.scsj.supermarket.R;
import com.scsj.supermarket.adapter.ShareProfitAdapter;
import com.scsj.supermarket.bean.ShareProfitBean;
import com.scsj.supermarket.view.activity.baseactivitymodel.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * 分润账单
 */
public class ShareProfitActivity extends BaseActivity {

    private TextView mTvWaitForSettle;
    private TextView mTvHadSettle;
    private RecyclerView mRecyclerShareprofit;
    private RelativeLayout mNullLayout;

    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_share_profit);
        //  ScreenAdapterTools.getInstance().loadView((ViewGroup)getWindow().getDecorView());
        //ScreenAdapterTools.getInstance().reset(this);//如果希望android7.0分屏也适配的话,加上这句
        initToolbar();
        setToolbarTitle("分润账单");
        hasBack(true);
        initView();
    }

    @Override
    protected void initView() {

        mTvWaitForSettle = (TextView) findViewById(R.id.tv_wait_for_settle);
        mTvHadSettle = (TextView) findViewById(R.id.tv_had_settle);
        mRecyclerShareprofit = (RecyclerView) findViewById(R.id.recycler_shareprofit);
        mNullLayout = (RelativeLayout) findViewById(R.id.null_layout);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initData() {
        List list = new ArrayList<ShareProfitBean>();
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        list.add(new ShareProfitBean("2018年8月8号", "已结算", 880.00));
        ShareProfitAdapter shareProfitAdapter = new ShareProfitAdapter(list);
        mRecyclerShareprofit.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerShareprofit.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
        mRecyclerShareprofit.setAdapter(shareProfitAdapter);
    }
}
